<?php

class DateForm extends Block{
	public $templatePath = __DIR__ ;
	public $templateFile = "DateForm.tpl.std.html";
	public $caption = "Date";
	public $description="Date";
	public $day  = 01;
	public $month= 01;
	public $year = 2014;
	public $date = "01/01/2014";
	
	
	public function show(){
		$this->parseFromFile($this->templatePath."/".$this->templateFile);
		
		$this->day    = isset($_REQUEST[$this->oid]['day'])?$_REQUEST[$this->oid]['day']:date('d');
		$this->month  = isset($_REQUEST[$this->oid]['month'])?$_REQUEST[$this->oid]['month']:date('m');
		$this->year   = isset($_REQUEST[$this->oid]['year'])?$_REQUEST[$this->oid]['year']:date('Y');
		$this->date = "{$this->day}/{$this->month}/{$this->year}";
		$this->description = "Date {$this->date}<br>";
		return $this->replace();
	}
}

?>